Enforcing Grammar in Code Synthesis with Transformers
نویسندگان
چکیده
Even more so than natural language, code is extremely sensitive to syntax; a small error could make an entire snippet invalid. It therefore important explore methods for ensuring syntactic correctness in generated code. Existing resolve this issue often rely on the complex architecture of syntax-guided decoders. In work, we present grammar enforcement method, which introduces separate layer that constrains decisions transformer during fine-tuning according constructs both target language and given training set. We experiment with Hearthstone dataset study its effects result programs compare it existing state-of-art demonstrate statistically significant positive effect quality terms exact match accuracy grammatically correct percent samples. At same time, observe lower values text-based metrics, chrF, BLEU, potentially indicating their inability represent abstract syntax sequences.
منابع مشابه
CMOD : Enforcing Modularity in C Code
Many modern languages have sophisticated linguistic support for modular programming. In these languages, the different components of a system can be developed independently, and when combined together the resulting program will be type correct. The C programming language does not contain direct support for modules, but over time programmers have developed a discipline of modular programming whi...
متن کاملThe Grammar of Code Switching
The idea that language is a homogeneous code is a massive simplification. In actual fact, we constantly use a wide array of codes, be they other languages, dialects, registers, or special purpose codes (for bank account numbers, book numbers, shoe sizes, and so on). In this paper we provide a formal analysis of code switching.
متن کاملAn Instrumenting Compiler for Enforcing Confidentiality in Low-Level Code
We present an instrumenting compiler for enforcing data confidentiality in low-level applications (e.g. those written in C) in the presence of an active adversary. In our approach, the programmer marks secret data by writing lightweight annotations on top-level definitions in the source code. The compiler then uses a static flow analysis coupled with efficient runtime instrumentation, a custom ...
متن کاملEnforcing Declarative Policieswith Targeted Program Synthesis
We present a technique for static enforcement of declarative information flow policies. Given a program that manipulates sensitive data and a set of declarative policies on the data, our technique automatically inserts policy-enforcing code throughout the program to make it provably secure with respect to the policies. We achieve this through a new approach we call targeted program synthesis, w...
متن کاملGenerating DNA Code Words Using Forbidding and Enforcing Systems
Research in DNA computing was initiated by Leonard Adleman in 1994 when he solved an instance of an NP-complete problem solely by molecules. DNA code words arose in the attempt to avoid unwanted hybridizations of DNA strands for DNA based computations. Given a set of constraints, generating a large set of DNA strands that satisfy the constraints is an important problem in DNA computing. On the ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ... International Florida Artificial Intelligence Research Society Conference
سال: 2023
ISSN: ['2334-0762', '2334-0754']
DOI: https://doi.org/10.32473/flairs.36.133363